# -*- coding: utf-8 -*-
from application import app


class UrlManager(object):
    def __init__(self):
        pass

    @staticmethod
    def buildUrl( path ):
        return path

    @staticmethod
    def buildStaticUrl(path):
        ver = "%s"%( 22222222 )
        path =  "/static" + path + "?ver=" + ver
        return UrlManager.buildUrl( path )

    @staticmethod
    def buildImageUrl(path):  # 图片的地址，在美食列表中set上传图片展示中使用到
        app_config = app.config['APP']
        #'domain': 'http://192.168.3.178:8999'
        url = app_config['domain'] + app.config['UPLOAD']['prefix_url'] +path
        return url